package com.sdleyou.treepro.manager.api.system;

import com.sdleyou.treepro.common.model.utils.ResultVOUtil;
import com.sdleyou.treepro.common.model.vo.ResultVO;
import com.sdleyou.treepro.common.model.vo.SloganVO;
import com.sdleyou.treepro.common.service.ContactManager;
import com.sdleyou.treepro.common.service.SloganManager;
import com.sdleyou.treepro.system.version.ApiVersion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotEmpty;

/**
 * 联系我们控制器
 */
@RestController
@RequestMapping("/api")
public class ManagerContactController {

    @Autowired
    private ContactManager contactManager;

    @ApiVersion(1)
    @PostMapping("/{version}/manager/contact")
    public ResultVO create(@RequestParam(name = "wx_code") @NotEmpty(message = "微信号不能为空") String wxCode,
                           @RequestParam(name = "wx_img") @NotEmpty(message = "图片不能为空") String wxImg) {
        contactManager.createContact(wxCode, wxImg);
        return ResultVOUtil.success();
    }

}
